package com.fawde.mall.controller;


import com.fawde.mall.entity.User;
import com.fawde.mall.service.IUserService;
import com.fawde.mall.vo.RespBean;
import com.fawde.mall.vo.RespBeanEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import org.springframework.stereotype.Controller;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author xiaohei
 * @since 2023-01-18
 */
@RestController
@RequestMapping("/mall/user")
public class UserController {

    @Autowired
    private IUserService iUserService;
    @RequestMapping ("/selectUserList")
    public String selectUserList(){

        List list = iUserService.list();
        return   RespBean.retData(RespBeanEnum.SUCCESS,list);
    }
    @RequestMapping ("/selectStr")
    public String selectStr(){
        return   RespBean.retData(RespBeanEnum.SUCCESS,"返回成功");
    }
    @PostMapping("/getYourUser")
    public String getYourName(@RequestBody User user){
        return RespBean.retData(RespBeanEnum.SUCCESS,user.toString());
    }
    @GetMapping ("/getYourPram")
    public String getYourPram(String pram){
        return RespBean.retData(RespBeanEnum.SUCCESS,"{pram:"+pram+"}");
    }
}
